import {Userinfo} from "@/model/personalCenter/userinfo";

//文章参数类型
export interface Article {
    id: number,
    userId: number,
    title: string,
    content: string,
    views: number,
    commentCount: number,
    likeCount: number,
    collectCount: number,
    label?: string,
    grade?: number,
    type: number,
    createTime: Date,
    updateTime: Date,
    user: Userinfo,
    labels: Array<string>,
    gradeTranslation: string,
    labelTranslation: string,
    isLike?: number,
    isCollect?: number
}

//写文章需要的参数类型
export interface ArticleVo {
    id: number,
    userId: number,
    title: string,
    content: string,
    label: string,
    grade: number,
    type: number,
    keyword: string
}

//点赞所需的参数类型
export interface GiveALike {
    articleId: number,
    userId: number
}

//收藏所需的参数类型
export interface Collect {
    articleId: number,
    userId: number,
}

//收藏所需的参数类型
export interface CollectBrowse {
    id: number,
    articleId: number,
    userId: number,
    createTime: Date,
    articles: Article
}

//一级评论所需的参数
export interface CommentsVo {
    articleId: number,
    content: string,
    userId: number,
    nickname: string,
    avatar: string
}

export interface Comments {
    id: number,
    articleId: number,
    content: string,
    userId: number,
    nickname: string,
    avatar: string,
    likeCount: number,
    isTop: number,
    createTime: Date,
    isLike: number,
    secondCommentsList: Array<SecondComments>
}

//二级评论数据相关的类型
export interface SecondComments {
    id: number,
    articleId: number,
    firstId: number,
    secondUserId: number,
    secondOneNickname: string,
    secondOneAvatar: string,
    secondTwoUserId: number,
    secondTwoNickname: string,
    secondTwoAvatar: string,
    content: string,
    createTime: Date,
    isRead: number
}

//二级评论所需的参数
export interface SecondCommentsParams {
    articleId: number,
    firstId: number,
    secondUserId: number,
    secondOneNickname: string,
    secondOneAvatar: string,
    secondTwoUserId: number,
    secondTwoNickname: string,
    secondTwoAvatar: string,
    content: string,
}

//评论点赞需要的参数类型
export interface CommentsGiveALike {
    articleId: number,
    parentId: number,
    userId: number
}

//保存用户浏览文章记录需要的参数类型
export interface Browse {
    articleId: number,
    userId: number
}